package org.jeecg.modules.demo.hjyzbj.service.impl;

import org.jeecg.modules.demo.hjyzbj.entity.ZwglEltq;
import org.jeecg.modules.demo.hjyzbj.entity.ZwglEltqsz;
import org.jeecg.modules.demo.hjyzbj.entity.ZwglHjyzsz;
import org.jeecg.modules.demo.hjyzbj.mapper.ZwglEltqszMapper;
import org.jeecg.modules.demo.hjyzbj.mapper.ZwglHjyzszMapper;
import org.jeecg.modules.demo.hjyzbj.mapper.ZwglEltqMapper;
import org.jeecg.modules.demo.hjyzbj.service.IZwglEltqService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 恶劣天气
 * @Author: jeecg-boot
 * @Date:   2023-04-19
 * @Version: V1.0
 */
@Service
public class ZwglEltqServiceImpl extends ServiceImpl<ZwglEltqMapper, ZwglEltq> implements IZwglEltqService {

	@Autowired
	private ZwglEltqMapper zwglEltqMapper;
	@Autowired
	private ZwglEltqszMapper zwglEltqszMapper;
	@Autowired
	private ZwglHjyzszMapper zwglHjyzszMapper;
	
	@Override
	@Transactional(rollbackFor = Exception.class)
	public void delMain(String id) {
		zwglEltqszMapper.deleteByMainId(id);
		zwglHjyzszMapper.deleteByMainId(id);
		zwglEltqMapper.deleteById(id);
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			zwglEltqszMapper.deleteByMainId(id.toString());
			zwglHjyzszMapper.deleteByMainId(id.toString());
			zwglEltqMapper.deleteById(id);
		}
	}
	
}
